const postcss = require('postcss');
// const postcssPresetEnv = require('postcss-preset-env');
// const loaderUtils = require('loader-utils');
const schema = { type: 'object', properties: {} }; // 根据需要定义 schema

module.exports = function(source) {
    console.log(source)
    const options = loaderUtils.getOptions(this) || {};
    const callback = this.async();

    postcss([postcssPresetEnv(options)])
        .process(source, { from: this.resourcePath, to: undefined })
        .then(result => {
            console.log(result)
            debugger
            callback(null, result.css);
        })
        .catch(error => {
            callback(error);
        });
};
